package com.ostrich.module_more.ui

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.alibaba.android.arouter.facade.annotation.Route
import com.ostrich.library_base.BaseFragment
import com.ostrich.library_common.route.RouterFragmentPath
import com.ostrich.module_community.adapter.MoreFragmentAdapter
import com.ostrich.module_more.R
import com.ostrich.module_more.databinding.MoreFragmentMoreBinding
import com.ostrich.module_more.message.MessageFragment
import com.ostrich.module_more.themes.ThemesFragment
import com.ostrich.module_more.topic.TopicFragment

@Route(path = RouterFragmentPath.PAGER_MORE)
class MoreFragment : BaseFragment<MoreFragmentMoreBinding>() {
    private val titles = mutableListOf<String>()
    private val fragments = mutableListOf<Fragment>()
    private lateinit var moreFragmentAdapter: MoreFragmentAdapter
    init {
        titles+="主题"
        titles+="推送"
        titles+="互动"
        fragments+=ThemesFragment()
        fragments+=MessageFragment()
        fragments+=TopicFragment()

    }
    override fun initView() {
        binding?.let {
            moreFragmentAdapter = MoreFragmentAdapter(titles, fragments,childFragmentManager)
            it.vpHomeContent.adapter = moreFragmentAdapter
            it.tabLayout.setupWithViewPager(it.vpHomeContent)

        }

    }

    override fun initData() {

    }

    override fun initListener() {

    }

    override fun bindLayout(): Int {
        return R.layout.more_fragment_more
    }


}